<% form_for [:admin, @product_image], :url => path, :html => {:class => :form , :multipart => true} do |form| %>
  <table class="data2 data3" cellspacing="0">
    <tr>
      <th><label><%= ProductImage.human_attribute_name("image") %>:</label></th>
      <td>
        <% if action_name=='update'||action_name=='edit' %>
          <% if  @product_image.image_file_name.blank? %>
            无图片
          <% else %>
            <%= image_tag  @product_image.image.url(:thumb) %>
          <% end %>
        <% end %><br />
        <%= form.file_field :image %><span class="note2">&nbsp;必须</span>
        <%= error_message_on :product_image, :image %>
      </td>
    </tr>
    <tr><td  class="center" colspan="2"><%= form.submit t('labels.save'), :class => 'btn_s' %></td></tr>
  </table>
<% end %>
<div class="link-right">
  <%= link_to '返 回', admin_product_images_path, :class=>"link_s"%>
</div>